﻿using GLstudent.DAL;
using GLstudent.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace GLstudent.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class studentController : ControllerBase
    {
        private DAL_student student = new DAL_student();
        /// <summary>
        /// 按学号查询成绩
        /// </summary>
        /// <param name="sxuehao">学生学号</param>
        /// <returns></returns>
        [HttpGet]
        public List<chengjishitu> chaxunid(string sxuehao)
        {
            return student.chaxunid(sxuehao);
        }
        /// <summary>
        /// 模糊查学生成绩
        /// </summary>
        /// <param name="mohu">模糊查询输入的字符</param>
        /// <param name="sxuehao">学生学号</param>
        /// <returns></returns>
        [HttpGet]
        public List<chengjishitu> mohuchengji(string mohu,string sxuehao)
        {
            return student.mohuchengji(mohu,sxuehao);
        }
        /// <summary>
        /// 按ID查询成绩的方法
        /// </summary>
        /// <param name="id">要查询的id</param>
        /// <returns></returns>
        [HttpGet]
        public chengjishitu teacherid(int id)
        {
            return student.chaxunkechengid(id);
        }
    }
}
